package com.wuxiaolong.wechat.common;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * Description:
 *
 * @author Leo
 * @date 2020-02-12
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
public class JsonResult<T> {

    private Integer code;
    private String msg;
    private T data;


    public JsonResult(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public JsonResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public JsonResult(T data) {
        this.code = ResultCode.SUCC.getCode();
        this.msg = ResultCode.SUCC.getMsg();
        this.data = data;
    }

}
